package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.domain.entity.ClazzStudentCountInfo;
import com.itheima.domain.pojo.Student;
import com.itheima.domain.query.QueryParam;
import com.itheima.domain.vo.StudentDegreeInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:篍
 * @Date: 2025/07/14 19:28
 * @Description:
 */
@Mapper
public interface StudentMapper {

    Page<Student> findAllStudents(QueryParam queryParam);

    void addStudent(Student student);

    Student findStudentById(Integer id);

    Long findNo(String no);

    Long findPhone(String phone);

    Long findIdCard(String idCard);

    //修改学生
    void updateStudent(Student student);

    //根据id数组删除学员
    void deleteStudent(@Param("ids") Integer[] ids);

    //根据id计算违纪扣分
    void violationScore(@Param("id") Integer id, @Param("score") Short score);

    //学员学历统计
    List<StudentDegreeInfo> studentDegreeReport();

    List<ClazzStudentCountInfo> studentCountReport();

    //根据班级id查询是否该班级有学生
    long findStudentCountByClazzId(Integer clazzId);
}
